#define _CRT_SECURE_NO_WARNINGS 1


#include"Sort.h"
#include"Heap.h"
#include"Stack.h"




void TestInsertSort()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	InsertSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestShellSort()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	ShellSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestSelectSort()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	SelectSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestBubbleSort()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	BubbleSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestHeapSort()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	HeapSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}


void TestQuickSort()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	QuickSort(a, 0, (sizeof(a) / sizeof(int)) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestQuickSortThree()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	QuickSortThree(a, 0, (sizeof(a) / sizeof(int)) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestQuickSortNonR()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	QuickSort(a, 0, (sizeof(a) / sizeof(int)) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TesMergeSort()
{
	int a[] = { 7,5,8,1,4,6,9,3,2,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	MergeSort(a,(sizeof(a) / sizeof(int)));
	PrintArray(a, sizeof(a) / sizeof(int));
}


void TesMergeSortNonR()
{
	int a[] = { 7,5,8,1,4,6,9,3,2};
	PrintArray(a, sizeof(a) / sizeof(int));
	MergeSortNonR(a, (sizeof(a) / sizeof(int)));
	PrintArray(a, sizeof(a) / sizeof(int));
}

int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestSelectSort();
	//TestBubbleSort();
	//TestHeapSort();
	//TestQuickSort();
	//TestQuickSortNonR();
	//TesMergeSort();
	//TesMergeSortNonR();
	TestQuickSortThree();

	return 0;
}